import Cookies from "js-cookie";

const TokenKey = "Admin-Token";
const MenuKey = "Admin-Menu";
const InfoKey = "Admin-Info";
const attachKey = "Admin-attach";
const urldataKey = "Admin-urldata";
const Deadline = "Admin-Deadline";

export function getToken() {
  return Cookies.get(TokenKey);
}

export function setToken(token) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function getMenu() {
  return localStorage.getItem(MenuKey);
}

export function setMenu(menu) {
  return localStorage.setItem(MenuKey, menu);
}

export function removeMenu() {
  return localStorage.removeItem(MenuKey);
}

export function getInfo() {
  return Cookies.get(InfoKey);
}

export function setInfo(info) {
  return Cookies.set(InfoKey, info);
}

export function removeInfo() {
  return Cookies.remove(InfoKey);
}

export function getAttach() {
  return Cookies.get(attachKey);
}

export function setAttach(info) {
  return Cookies.set(attachKey, info);
}

export function removeAttach() {
  return Cookies.remove(attachKey);
}

export function getDeadline() {
  return Cookies.get(Deadline);
}

export function setDeadline(info) {
  return Cookies.set(Deadline, info);
}

export function removeDeadline() {
  return Cookies.remove(Deadline);
}

export function getUrldata() {
  return Cookies.get(urldataKey, { domain: "yutangwl.com" });
}

export function setUrldata(info) {
  return Cookies.set(urldataKey, info, { domain: "yutangwl.com" });
}

export function removeUrldata() {
  return Cookies.remove(urldataKey, { domain: "yutangwl.com" });
}
